<template>
    <div id="OrdersTitle">
        <v-details :inputConfig="inputConfig" :detailData="inputData" :rules="rules"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        props: {
            inputData: {
                type: Object,
            }
        },
        mixins: [baseMixin],
        name: "OrdersTitle",
        data() {
            return {
                rules: {},
                addflag: true,
                flag: true
            }
        },
        computed: {
            inputConfig() {
                if (this.flag) {
                    return [
                        [
                            {
                                type: "input",
                                label: "事件组",
                                disabled: this.addflag,
                                props: "event_group",
                            },
                            {
                                type: "input",
                                label: this.$t('common.desc'),
                                props: "event_desc",
                            },
                            {
                                type: "select",
                                label: "事件类型",
                                props: "event_type",
                                options: this.getOptions("getSelectCode/EVENT_TYPE/TYPE_DESC/BIC_CODE_EVENTTYPE/language='zh'")
                            }
                        ]
                    ]
                } else {
                    return [
                        [
                            {
                                type: "input",
                                label: "事件组",
                                disabled: this.addflag,
                                props: "to_event_group",
                            }
                        ]
                    ]
                }

            }
        },
        methods: {},
        mounted() {
            if (Object.keys(this.$store.state.skip).length != 0) {
                let data = this.$store.state.skip;
                if (!data.newFlag) {
                    this.addflag = true;
                }
            } else if (this.$store.state.temporary != "") {
                this.flag = false;
                this.addflag = false;
            } else if (!this.$store.state.newFlag) {
                this.addflag = true;
            } else {
                this.addflag = false;
            }
        },
        watch: {},
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
